package main

import (
	"encoding/json"
	"fmt"
)

type Person struct { 
	Name    string            `json:"my_name,omitempty"`
	Age     int64             `json:"age,omitempty"`
	Job     string            `json:"job,omitempty"`
	Weight  float64           `json:"weight,omitempty"` 
	Hobby   []string          `json:"hobby,omitempty"`
	Class   map[string]string `json:"class,omitempty"`
	Profile `json:"profile"`  
}

type Profile struct {
	Website string `json:"website,omitempty"` 
	Slogan  string `json:"slogan"`            
	Address string `json:"address"`
}

func main() {

	p1 := Person{
		Name: "邹邹",
		Profile: Profile{ 
			Address: "成都",
		},
	}

	b, err := json.Marshal(p1)
	if err != nil {
		fmt.Printf("json 序列化失败，err:%v\n", err)
		return
	}
	fmt.Printf("b:%s\n", b)
}
